#include <tut.h>
#include "Pennyworth.h"

namespace tut
{
	struct basic
	{
	};
	typedef test_group<basic> sensor;
	typedef sensor::object sensor_object;
}

namespace
{	
	tut::sensor tf("Pennyworth::Sensors::Sensor Tests");
}

namespace tut
{
	template<>
	template<>
	void sensor_object::test<1>()
	{
		Pennyworth::Sensors::Sensor * sensor_plain = new Pennyworth::Sensors::Sensor();
		std::wstring * plain_name = new std::wstring(L"Generic Sensor");
		ensure_equals("sensor_plain.name = 'Generic Sensor'", true, (*(sensor_plain->name()) == *plain_name));
		delete plain_name;
	}

	template<>
	template<>
	void sensor_object::test<2>()
	{
		std::wstring * detailed_name = new std::wstring(L"Test Sensor");
		std::wstring * detailed_description = new std::wstring(L"This is a test sensor");
		Pennyworth::Sensors::Sensor * sensor_detailed = new Pennyworth::Sensors::Sensor(detailed_name, detailed_description, 43, NULL);

		ensure_equals("sensor_detailed.name = 'Test Sensor'", true, (*(sensor_detailed->name()) == *detailed_name));
		ensure_equals("sensor_detailed.description = 'This is a test sensor'", true, (*(sensor_detailed->description()) == *detailed_description));
		ensure_equals("sensor_detailed.identifier = 43", 43, sensor_detailed->identifier());
		
		delete detailed_name;
		delete detailed_description;
	}
}